<template>
  <div class="collasebox">
    <el-button
      class="colCardBox"
      style=""
      icon="el-icon-d-arrow-right"
      @click="collapseCardBox"
    />
    <div class="card">
      <div class="card-content">
        <div class="but-group">
          <slot name="butgroup" />
        </div>
        <div class="content-group">
          <slot name="contentgroup" />
        </div>
      </div>

    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      colCardBox: false
    }
  },
  methods: {
    collapseCardBox() {
      this.colCardBox = !this.colCardBox
      if (this.colCardBox) {
        $('.card').css('display', 'none')
        $('.colCardBox').css('right', '0')
        $('.colCardBox i').attr('class', 'el-icon-d-arrow-left')
      } else {
        $('.card').css('display', 'block')
        $('.colCardBox').css('right', '230px')
        $('.colCardBox i').attr('class', 'el-icon-d-arrow-right')
      }
    }
  }
}
</script>

<style scoped>
.collasebox {
  position: fixed;
  right: 0;
  z-index: 10;
}
.colCardBox {
  position: absolute;
  top: 22px;
  right: 230px;
  z-index: 999;

}
.collapse2 .el-collapse-item__header {
  color: #000;
  font-size: 12px;
  font-weight: 400;
  background-image: linear-gradient(180deg, #fff, #fff) !important;
  padding-left: 20px;
}

.card {
  width: 300px;
  z-index: 1;
  position: absolute;
  top: 0px;
  right: 0px;
  background: white;
  padding: 12px;
  border-radius: 5px;
    box-shadow: 0 0 6px -3px gray;
}
.but-group {
  margin-top: 10px;
  margin-left: 66px;
  margin-bottom: 12px;
}
.card-content {
    position: relative;
    display: flex;
    flex-direction: column;
}
</style>
